package com.wzqj.agent.web.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.wzqj.agent.web.dao.AgentMerchantDao;
import com.wzqj.agent.web.domain.AgentMerchant;
import com.wzqj.agent.web.service.AgentMerchantService;

@Service("agentMerchantService")
public class AgentMerchantServiceImpl implements AgentMerchantService {
	@Autowired
	private AgentMerchantDao agentMerchantDao;

	/**
	 * 绑定门店到代理商
	 * 
	 * @param qualificationid
	 * @param userId
	 * @return
	 */
	public boolean bindMerchantToAgent(String qualificationid, long agentId) {
		boolean flag = false;
		AgentMerchant agentMerchant  = new AgentMerchant();
		agentMerchant.setAgentId(agentId);
		agentMerchant.setMerId(qualificationid);
		int insert = agentMerchantDao.insert(agentMerchant);
		if (insert > 0) {
			flag = true;
		}
		return flag;
	}

}
